package com.ag.bean;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbRole entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_ROLE", schema = "dbo", catalog = "AGDB")
public class TbRole implements java.io.Serializable {

	// Fields

	private String RId;
	private String RName;
	private String a;
	private String b;
	private String c;
	private Set<TbUserRole> tbUserRoles = new HashSet<TbUserRole>(0);
	private Set<TbRolePermission> tbRolePermissions = new HashSet<TbRolePermission>(
			0);

	// Constructors

	/** default constructor */
	public TbRole() {
	}

	/** minimal constructor */
	public TbRole(String RId, String RName) {
		this.RId = RId;
		this.RName = RName;
	}

	/** full constructor */
	public TbRole(String RId, String RName, String a, String b, String c,
			Set<TbUserRole> tbUserRoles, Set<TbRolePermission> tbRolePermissions) {
		this.RId = RId;
		this.RName = RName;
		this.a = a;
		this.b = b;
		this.c = c;
		this.tbUserRoles = tbUserRoles;
		this.tbRolePermissions = tbRolePermissions;
	}

	// Property accessors
	@Id
	@Column(name = "R_ID", unique = true, nullable = false, length = 4)
	public String getRId() {
		return this.RId;
	}

	public void setRId(String RId) {
		this.RId = RId;
	}

	@Column(name = "R_NAME", nullable = false, length = 30)
	public String getRName() {
		return this.RName;
	}

	public void setRName(String RName) {
		this.RName = RName;
	}

	@Column(name = "A", length = 60)
	public String getA() {
		return this.a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@Column(name = "B", length = 60)
	public String getB() {
		return this.b;
	}

	public void setB(String b) {
		this.b = b;
	}

	@Column(name = "C", length = 60)
	public String getC() {
		return this.c;
	}

	public void setC(String c) {
		this.c = c;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbRole")
	public Set<TbUserRole> getTbUserRoles() {
		return this.tbUserRoles;
	}

	public void setTbUserRoles(Set<TbUserRole> tbUserRoles) {
		this.tbUserRoles = tbUserRoles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbRole")
	public Set<TbRolePermission> getTbRolePermissions() {
		return this.tbRolePermissions;
	}

	public void setTbRolePermissions(Set<TbRolePermission> tbRolePermissions) {
		this.tbRolePermissions = tbRolePermissions;
	}

}